networks:
  my_network:
    name: my_network

services:
  my_nginx:
    container_name: my_nginx
    image: nginx
    ports:
      - 8085:80
    volumes:
      - ./vhost.conf:/etc/nginx/conf.d/default.conf
      - ./www:/var/www/public_html
    networks:
      - my_network
    depends_on:
      - my_php
      - my_db

  my_php:
    container_name: my_php
    build: ./images/php
    volumes:
      - ./www:/var/www/public_html
    networks:
      - my_network
    depends_on:
      - my_db

  my_db:
    container_name: my_db
    image: mysql
    volumes:
      - ./mysql-data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
    networks:
      - my_network

  my_dbadmin:
    container_name: my_dbadmin
    image: phpmyadmin
    ports:
      - 1500:80
    environment:
      - PMA_HOST=my_db
    networks:
      - my_network
    depends_on:
      - my_db
